Skip to content

chore(): improve new link checker - #7547

Closed
mhartington wants to merge 8 commits into
mainfrom
improve-external-link-check
Closed

mhartington wants to merge 8 commits into
mainfrom
improve-external-link-check

Conversation

@mhartington

@mhartington mhartington commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • CI now runs an external link checker on PRs, generates detailed JSON reports, formats a Markdown summary, and posts a PR comment. Checker returns consistent exit codes when failures are found.
    • CLI can emit detailed JSON output for link scans.
  • Chores

    • Replaced the old link-check workflow with the new workflow and improved per-file aggregation.
    • Added configurable concurrency for file extraction and URL checking via environment variables.
  • Other

    • Minor CLI argument parsing terminator added.

@vercel

vercel Bot commented Feb 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Feb 23, 2026 7:13pm
docs Ready Ready Preview, Comment Feb 23, 2026 7:13pm

Request Review

@coderabbitai

coderabbitai Bot commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Reworks the external-links checker into a two‑phase, concurrency‑configurable flow with per‑file aggregation and JSON reporting; adds a GitHub Actions workflow to run and format the checker on PRs; removes the old Lychee workflow; and updates an npm script argument terminator.

Changes

Cohort / File(s) Summary
External links linter script
apps/docs/scripts/lint-external-links.ts
Rewrites checker to separate file-extraction and URL-check phases with distinct defaults (DEFAULT_FILE_CONCURRENCY=15, DEFAULT_URL_CHECK_CONCURRENCY=40), adds readPositiveIntEnv(), makes collectFileLinks async (uses fs.promises), introduces LinkCheckReport, merges per-file occurrences, provides --json output, and adjusts exit codes and metrics.
New workflow: run external checker
.github/workflows/external-links.yml
Adds an "External Links" GitHub Actions workflow for PRs: setup, install, run the TS link checker capturing JSON+stderr, format a Markdown report (external-links/formatted.md), append to PR summary and post a sticky comment (non-fork PRs), and fail the job on checker failures.
Removed workflow: lychee
.github/workflows/lychee.yml
Removes the prior Lychee-based link-check workflow and all associated retry, formatting, and comment steps.
npm script separator
package.json
Appends a -- terminator to the lint:external-links script invocation (turbo run lint:external-links --filter=docs --).
Minor file metadata
turbo.json
Only a trailing newline added; no functional changes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'chore(): improve new link checker' is vague and generic, using non-descriptive language that doesn't convey meaningful information about the specific changes in the changeset. Consider revising the title to be more specific. For example: 'chore: refactor external link checker with per-file concurrency and JSON reporting' would better communicate the main improvements introduced.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

3664 links: ✅ 2743 OK | 🚫 0 errors | 🔀 255 redirects | 👻 664 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 2743
🔀 Redirected 255
👻 Excluded 664
🚫 Errors 0
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
apps/docs/scripts/lint-external-links.ts (2)

297-316: Two-phase design (collect then validate) is a solid architectural choice.

Separating link extraction from URL validation is cleaner and more efficient — you deduplicate URLs before hitting the network, and the two phases have independent concurrency knobs. Good stuff.

One note on lines 314–315: perFileOccurrences.push(...) and extractedLinks += ... mutate shared state from within concurrent workers. This is safe in Node.js because there's no await between the mutation and the next yield point (JS is cooperative, not preemptive). Just calling it out so future readers don't panic — a brief inline comment would help.

📝 Optional: add a clarifying comment
+    // Safe to mutate – no `await` between here and the next iteration,
+    // so no other worker can interleave.
     perFileOccurrences.push(localOccurrences);
     extractedLinks += links.length;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/lint-external-links.ts` around lines 297 - 316, The
concurrent worker body mutates shared variables perFileOccurrences and
extractedLinks which can look unsafe; add a brief inline comment right above the
perFileOccurrences.push(localOccurrences) and extractedLinks += links.length
lines explaining that this mutation is safe because runWithConcurrency runs on
Node's single-threaded event loop (no preemptive multithreading) and there is no
await between the read/modify/write steps, so the operations are atomic in this
context; reference the worker function passed to runWithConcurrency and the
local variable localOccurrences in the comment so readers can locate the code
quickly.

267-279: mergeOccurrences aliases source arrays into target — consider cloning.

On line 277, when a URL isn't yet in the target map, you set the reference directly: target.set(url, occurrences). This means target and source now share the same array instance. If anything ever mutates the source map's arrays after merging, the target map silently reflects those changes too.

In your current usage this is safe because perFileOccurrences entries aren't touched after merge. But it's a subtle footgun for future maintainers. A shallow copy ([...occurrences]) on line 277 would eliminate this coupling at negligible cost.

♻️ Optional: break the shared reference
-    target.set(url, occurrences);
+    target.set(url, [...occurrences]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/lint-external-links.ts` around lines 267 - 279, The
mergeOccurrences function currently aliases the source array into the target by
calling target.set(url, occurrences), which creates a shared mutable reference;
change the behavior so you insert a shallow copy of the occurrences array when
the URL is new (i.e., set the target entry to a new array containing the same
items instead of the original array) to avoid accidental future mutations of
source affecting target while preserving current semantics; update the logic in
mergeOccurrences where target.set is called for a non-existing key to store a
copied array rather than the original.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/docs/scripts/lint-external-links.ts`:
- Around line 297-316: The concurrent worker body mutates shared variables
perFileOccurrences and extractedLinks which can look unsafe; add a brief inline
comment right above the perFileOccurrences.push(localOccurrences) and
extractedLinks += links.length lines explaining that this mutation is safe
because runWithConcurrency runs on Node's single-threaded event loop (no
preemptive multithreading) and there is no await between the read/modify/write
steps, so the operations are atomic in this context; reference the worker
function passed to runWithConcurrency and the local variable localOccurrences in
the comment so readers can locate the code quickly.
- Around line 267-279: The mergeOccurrences function currently aliases the
source array into the target by calling target.set(url, occurrences), which
creates a shared mutable reference; change the behavior so you insert a shallow
copy of the occurrences array when the URL is new (i.e., set the target entry to
a new array containing the same items instead of the original array) to avoid
accidental future mutations of source affecting target while preserving current
semantics; update the logic in mergeOccurrences where target.set is called for a
non-existing key to store a copied array rather than the original.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1099089 and b6e4c0c.

📒 Files selected for processing (1)
  • apps/docs/scripts/lint-external-links.ts

coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 23, 2026
@github-actions

github-actions Bot commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

External Link Check Report

  • Scanned files: 679
  • Extracted external links: 3421
  • Unique links checked: 1229
  • Failed links: 13

Failures

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
apps/docs/scripts/lint-external-links.ts (1)

153-153: MARKDOWN_IMAGE_REGEX.lastIndex = 0 is dead code — the regex is never iterated.

MARKDOWN_IMAGE_REGEX is reset here but has no corresponding while loop in collectFileLinks. Image links are already excluded by the (?<!!) negative lookbehind in MARKDOWN_LINK_REGEX (line 30), so this reset serves no purpose.

🧹 Proposed cleanup
-  MARKDOWN_IMAGE_REGEX.lastIndex = 0;
   MARKDOWN_LINK_REGEX.lastIndex = 0;
   AUTOLINK_REGEX.lastIndex = 0;
   HTML_ANCHOR_REGEX.lastIndex = 0;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/lint-external-links.ts` at line 153, Remove the dead reset
of the MARKDOWN_IMAGE_REGEX in collectFileLinks: the statement
"MARKDOWN_IMAGE_REGEX.lastIndex = 0" is unnecessary because MARKDOWN_IMAGE_REGEX
is never iterated and image links are already excluded by the negative
lookbehind in MARKDOWN_LINK_REGEX; delete that line (referencing
MARKDOWN_IMAGE_REGEX and the collectFileLinks function) to clean up the
codebase.
.github/workflows/external-links.yml (1)

33-42: Add a step-level timeout to prevent runaway link-checker runs.

Without a timeout-minutes cap, a large docs site with hundreds of slow-responding external URLs could stall the job indefinitely (the script-level TIMEOUT_MS only gates individual URL fetches, not the whole run).

⏱️ Proposed fix
     - name: Run external link checker
       id: external-links
+      timeout-minutes: 30
       shell: bash
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml around lines 33 - 42, The "Run external
link checker" step (id: external-links) needs a step-level timeout to avoid
runaway runs; add a timeout-minutes value (for example timeout-minutes: 30 or an
appropriate cap for your CI budget) to the step definition that runs "pnpm run
lint:external-links" so the whole step is terminated if it exceeds that limit,
keeping the existing commands and exit handling intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/external-links.yml:
- Around line 33-42: The "Run external link checker" step (id: external-links)
needs a step-level timeout to avoid runaway runs; add a timeout-minutes value
(for example timeout-minutes: 30 or an appropriate cap for your CI budget) to
the step definition that runs "pnpm run lint:external-links" so the whole step
is terminated if it exceeds that limit, keeping the existing commands and exit
handling intact.

In `@apps/docs/scripts/lint-external-links.ts`:
- Line 153: Remove the dead reset of the MARKDOWN_IMAGE_REGEX in
collectFileLinks: the statement "MARKDOWN_IMAGE_REGEX.lastIndex = 0" is
unnecessary because MARKDOWN_IMAGE_REGEX is never iterated and image links are
already excluded by the negative lookbehind in MARKDOWN_LINK_REGEX; delete that
line (referencing MARKDOWN_IMAGE_REGEX and the collectFileLinks function) to
clean up the codebase.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6e4c0c and ae60e40.

📒 Files selected for processing (4)
  • .github/workflows/external-links.yml
  • .github/workflows/lychee.yml
  • apps/docs/scripts/lint-external-links.ts
  • package.json
💤 Files with no reviewable changes (1)
  • .github/workflows/lychee.yml

coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 23, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
.github/workflows/external-links.yml (4)

27-27: Upgrade to Node 22 (or 24) — Node 20 reaches EOL on April 30, 2026.

Node.js 20.x reaches end-of-life on April 30, 2026, which is only ~2 months away. Node.js 20 has been in Maintenance LTS since October 22, 2024, receiving only critical bug fixes and security patches. Setting up a brand-new workflow on a near-EOL runtime means you'll be forced to update it very soon.

Node 22 is currently in Maintenance LTS (EOL April 30, 2027), while Node 24 is the Active LTS release (EOL April 30, 2028). Node 22 is the safest drop-in upgrade.

⬆️ Proposed fix — use Node 22
-          node-version: "20"
+          node-version: "22"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml at line 27, The workflow currently pins
the runtime to node-version: "20" which will reach EOL soon; update the workflow
to use a supported LTS (change node-version: "20" to "22" or "24") in the
external-links.yml GitHub Actions job definition so the CI uses Node 22
(recommended) or Node 24 instead; ensure any job/matrix entries referencing
node-version (e.g., the node-version: "20" key) are updated consistently and
verify any Node-specific setup steps still work with the new version.

19-19: Consider pinning actions to full commit SHAs for supply-chain safety.

All four actions use mutable semver tags. A tag can be silently re-pointed to a different commit — especially relevant for the community-owned marocchino/sticky-pull-request-comment. Pinning to a specific SHA makes the used version immutable and auditable.

🔒 Example SHA-pinned alternatives (verify latest SHAs before using)
-        uses: actions/checkout@v4
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4

-        uses: pnpm/action-setup@v4
+        uses: pnpm/action-setup@fe02b74ar8d0fad1bea82ccd5a16c7e72d81e4f3  # v4

-        uses: actions/setup-node@v4
+        uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af  # v4

-        uses: marocchino/sticky-pull-request-comment@v2
+        uses: marocchino/sticky-pull-request-comment@773df9f8fc2f941882b5e9bb5c2f9b8a5c5a1c77  # v2

⚠️ The SHAs above are illustrative — fetch the real values via gh api repos/<owner>/<repo>/git/ref/tags/<tag> before committing.

Also applies to: 22-22, 25-25, 129-129

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml at line 19, Replace mutable semver tags
for third-party actions with immutable commit SHAs: find usages like
actions/checkout@v4, actions/setup-node@*,
marocchino/sticky-pull-request-comment@*, and the other action referenced in the
workflow and replace their tag (e.g., `@v4`) with the full commit SHA for that tag
(e.g., @<long-sha>); obtain the correct SHA using the GitHub API (gh api
repos/<owner>/<repo>/git/ref/tags/<tag>) and update each action reference so the
workflow pins to the exact commit SHA.

3-8: Consider adding a paths filter to avoid running the checker on unrelated PRs.

As written, the workflow runs on every PR regardless of which files changed. Since the checker scans docs content, PRs that touch only CI configs, scripts, or other non-docs files still pay the full cost of a network-bound link scan.

⚡ Example `paths` filter
 on:
   pull_request:
+    paths:
+      - 'apps/docs/**'
+      - '.github/workflows/external-links.yml'

Adjust the globs to match wherever the markdown/MDX source files actually live.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml around lines 3 - 8, The workflow
currently triggers on every pull request (see the pull_request trigger block and
concurrency group), causing unnecessary runs; add a paths filter under the
pull_request trigger (e.g., a paths: list with your repository's markdown/MDX
globs such as docs/**, content/**, **/*.md, **/*.mdx or similar) so the job only
runs when documentation files change, and adjust the globs to match where your
markdown/MDX live; keep the existing concurrency group unchanged.

78-79: Guard the integer comparison against a non-numeric failedLinks value.

jq -r '.failedLinks // 0' handles null/absent, but if the TypeScript script ever emits failedLinks as a string (note the // "n/a" fallbacks used elsewhere in the same jq calls), bash's -gt will abort with integer expression expected. A simple tonumber? in the jq expression is the cleanest fix.

🛡️ Proposed hardening
-          FAILED_COUNT="$(jq -r '.failedLinks // 0' "$JSON_FILE")"
+          FAILED_COUNT="$(jq -r '(.failedLinks | tonumber?) // 0' "$JSON_FILE")"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml around lines 78 - 79, The integer
comparison fails if FAILED_COUNT is non-numeric; update the jq invocation that
sets FAILED_COUNT (currently using ".failedLinks // 0") to coerce to a number
using jq's tonumber? before falling back so FAILED_COUNT is always numeric for
the bash "-gt" check; specifically modify the expression that produces
FAILED_COUNT (and keep using the same variable name) to use tonumber? with a //
0 fallback so non-numeric or missing failedLinks becomes 0.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/external-links.yml:
- Around line 56-62: When jq validation fails (the if block checking JSON_FILE
with jq), write a minimal fallback report into the same report output path
(e.g., REPORT_FILE / formatted.md) before calling exit 1 so the downstream
"Comment external links report" step always has a file; specifically, in the
failure branch that currently echoes "Invalid JSON in $JSON_FILE" and prints
OUTPUT_FILE, create or echo a simple error markdown summary into $REPORT_FILE
(or the same variable used later to generate formatted.md) containing the error
message and exit status, then exit 1; make sure to reference the existing shell
variables JSON_FILE, OUTPUT_FILE and REPORT_FILE/ formatted.md so the comment
step can find the fallback file.

---

Nitpick comments:
In @.github/workflows/external-links.yml:
- Line 27: The workflow currently pins the runtime to node-version: "20" which
will reach EOL soon; update the workflow to use a supported LTS (change
node-version: "20" to "22" or "24") in the external-links.yml GitHub Actions job
definition so the CI uses Node 22 (recommended) or Node 24 instead; ensure any
job/matrix entries referencing node-version (e.g., the node-version: "20" key)
are updated consistently and verify any Node-specific setup steps still work
with the new version.
- Line 19: Replace mutable semver tags for third-party actions with immutable
commit SHAs: find usages like actions/checkout@v4, actions/setup-node@*,
marocchino/sticky-pull-request-comment@*, and the other action referenced in the
workflow and replace their tag (e.g., `@v4`) with the full commit SHA for that tag
(e.g., @<long-sha>); obtain the correct SHA using the GitHub API (gh api
repos/<owner>/<repo>/git/ref/tags/<tag>) and update each action reference so the
workflow pins to the exact commit SHA.
- Around line 3-8: The workflow currently triggers on every pull request (see
the pull_request trigger block and concurrency group), causing unnecessary runs;
add a paths filter under the pull_request trigger (e.g., a paths: list with your
repository's markdown/MDX globs such as docs/**, content/**, **/*.md, **/*.mdx
or similar) so the job only runs when documentation files change, and adjust the
globs to match where your markdown/MDX live; keep the existing concurrency group
unchanged.
- Around line 78-79: The integer comparison fails if FAILED_COUNT is
non-numeric; update the jq invocation that sets FAILED_COUNT (currently using
".failedLinks // 0") to coerce to a number using jq's tonumber? before falling
back so FAILED_COUNT is always numeric for the bash "-gt" check; specifically
modify the expression that produces FAILED_COUNT (and keep using the same
variable name) to use tonumber? with a // 0 fallback so non-numeric or missing
failedLinks becomes 0.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e70f2c and 62c946b.

📒 Files selected for processing (1)
  • .github/workflows/external-links.yml

Comment thread .github/workflows/external-links.yml Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/external-links.yml (1)

44-91: Previous feedback on fallback report before exit 1 has been addressed.

The invalid-JSON branch now writes detailed error information (including the raw report and stderr) into $REPORT_FILE before exiting, so the downstream comment step will always have content to post. Well handled.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml around lines 44 - 91, The "Parse and
print external links report" step correctly handles the invalid-JSON branch by
writing detailed information (using REPORT_FILE, JSON_FILE, OUTPUT_FILE) into
the report before calling exit 1, so no code changes are required — keep the
current logic that writes the raw report and stderr into "$REPORT_FILE" and
appends it to "$GITHUB_STEP_SUMMARY" prior to exiting.
🧹 Nitpick comments (1)
.github/workflows/external-links.yml (1)

160-164: This step silently won't run if the "Comment" step fails, masking the real failure reason.

The "Fail if broken links found" step uses the default if: success() condition. If the comment step (line 153) fails — say, due to a permissions issue — this step is skipped entirely. The job does still fail, but the error message will point at the comment action rather than at broken links. This is a minor UX issue in failure diagnostics.

Adding if: always() here (and keeping the exit-code check) would ensure this step always reports clearly:

Proposed change
      - name: Fail if broken links found
-       if: ${{ steps.external-links.outputs.exit_code != '0' }}
+       if: ${{ always() && steps.external-links.outputs.exit_code != '0' }}
        run: |
          echo "External link checker failed."
          exit 1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/external-links.yml around lines 160 - 164, The "Fail if
broken links found" GitHub Actions step named "Fail if broken links found"
should not be gated by the default success() condition; change its condition to
always() while preserving the existing exit-code check (i.e., use if: ${{
always() && steps.external-links.outputs.exit_code != '0' }} or equivalent) so
the step always runs and reports a clear "External link checker failed." exit
when broken links are detected even if prior steps (like the "Comment" step)
failed; update the step's if expression accordingly and keep the existing run
block that echoes the message and exits 1.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/external-links.yml:
- Around line 118-151: The report block currently truncates REPORT_FILE (using
>) and thus overwrites the earlier "## External Link Check Report" header; fix
by either (Option A) changing the redirection in the happy-path block to append
(use >> "$REPORT_FILE" instead of > "$REPORT_FILE") so the prewritten header
remains, or (Option B) make the block self-contained by writing the header into
the same block that writes to REPORT_FILE (and remove the earlier header write)
so REPORT_FILE is complete when created; locate symbols REPORT_FILE, OUTPUT_FILE
and FAILED_COUNT in the block to implement the chosen change.

---

Duplicate comments:
In @.github/workflows/external-links.yml:
- Around line 44-91: The "Parse and print external links report" step correctly
handles the invalid-JSON branch by writing detailed information (using
REPORT_FILE, JSON_FILE, OUTPUT_FILE) into the report before calling exit 1, so
no code changes are required — keep the current logic that writes the raw report
and stderr into "$REPORT_FILE" and appends it to "$GITHUB_STEP_SUMMARY" prior to
exiting.

---

Nitpick comments:
In @.github/workflows/external-links.yml:
- Around line 160-164: The "Fail if broken links found" GitHub Actions step
named "Fail if broken links found" should not be gated by the default success()
condition; change its condition to always() while preserving the existing
exit-code check (i.e., use if: ${{ always() &&
steps.external-links.outputs.exit_code != '0' }} or equivalent) so the step
always runs and reports a clear "External link checker failed." exit when broken
links are detected even if prior steps (like the "Comment" step) failed; update
the step's if expression accordingly and keep the existing run block that echoes
the message and exits 1.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62c946b and 71b4c53.

📒 Files selected for processing (1)
  • .github/workflows/external-links.yml

Comment thread .github/workflows/external-links.yml Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes Feb 23, 2026

This branch was successfully deployed

2 active deployments
Preview – docs — fc287e21 Deployed Feb 23, 2026 by vercel[bot]
Preview – blog — fc287e21 Deployed Feb 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant